using Castle.ActiveRecord.Queries;
using Karma.Framework.Core.Metadata.Mapping;
using Karma.Framework.Core.Repository;

namespace Karma.Framework.Core.Modules.Metadata.Designer
{
    public class EntityRepository: RepositoryBase<Entity>, IEntityRepository
    {
        public Entity Get(string entityName)
        {
            var query = new SimpleQuery<Entity>("from Entity e where e.Name=:nombre");
            query.SetParameter("nombre", entityName);
            var result = query.Execute();
            return result.Length == 0 ? null : result[0];
        }
    }
}